package com.xgd.phylw.controller;

import com.xgd.phylw.bean.Hall;
import com.xgd.phylw.bean.Member;
import com.xgd.phylw.bean.Movie;
import com.xgd.phylw.bean.Orderd;
import com.xgd.phylw.service.AdminCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class AdminTndexController {
    @Autowired
    AdminCountService adminCountService;

    @RequestMapping("AdminIndex")
    public String PageChangeToIndex(Model model){
        List<Orderd> orderd = adminCountService.zhexiantu();//orderdId 暂用 conut条数
        long orderAll = adminCountService.orderAll();
        List<Member> member = adminCountService.membarBymemberTemp();//member_munber 暂用 conut条数
        Hall hall = adminCountService.hallCount();
        Movie movie = adminCountService.movieCount();
        List<Movie> movieList = adminCountService.MovieTempTop();


        model.addAttribute("orderd",orderd);
        model.addAttribute("orderAll",orderAll);
        model.addAttribute("member",member);
        model.addAttribute("hall",hall);
        model.addAttribute("movie",movie);
        model.addAttribute("movieTemp",movieList);
        return "admin_index";
    }
}
